




use "${pathdata_robustness}/RobustnessExperiment4.dta", clear


/* Treatments*/
	gen type = 1 if beliefs_type == "count" & inlist(condition, "storyshort_pos", "storyshort_neg") // Dissimilar
	replace type = 2 if beliefs_type == "percentage" & inlist(condition, "storyshort_pos", "storyshort_neg") // Similar
	replace type = 3 if beliefs_type == "count" & statistics_type == "count" & inlist(condition, "statistic_neg", "statistic_pos") // Dissimilar Dissimilar 
	replace type = 4 if beliefs_type == "count" & statistics_type == "percentage" & inlist(condition, "statistic_neg", "statistic_pos") // Dissimilar Similar
	replace type = 5 if beliefs_type == "percentage" & statistics_type == "count" & inlist(condition, "statistic_neg", "statistic_pos")  // Similar Dissimilar
	replace type = 6 if beliefs_type == "percentage" & statistics_type == "percentage" & inlist(condition, "statistic_neg", "statistic_pos")  // Similar Similar

gen delta = effect_recall - effect


preserve
collapse (mean) delta (sem) delta_sem = delta , by(type)	 
rename delta_sem sem0
rename delta dev0
gen upper=dev+sem
gen lower=dev-sem

tw (scatter dev type if type==1, connect(l)  mcolor(ebblue*1.5)) ///
(scatter dev type if type==2, connect(l)  mcolor(ebblue*1)) ///
(scatter dev type if type==3, connect(l)  mcolor(red*2.2)) ///
	(rcap upper lower type if type==1, lw(medthick) lcolor(ebblue*1.5))  ///
	(rcap upper lower type if type==2, lw(medthick) lcolor(ebblue*1)) ///
	(rcap upper lower type if type==3, lw(medthick) lcolor(red*2.2))  ///
(scatter dev type if type==4, connect(l)  mcolor(red*1.5)) ///
(scatter dev type if type==5, connect(l)  mcolor(red*1)) ///
(scatter dev type if type==6, connect(l)  mcolor(red*0.6)) ///
	(rcap upper lower type if type==4, lw(medthick) lcolor(red*1.5))  ///
	(rcap upper lower type if type==5, lw(medthick) lcolor(red*1)) ///
		(rcap upper lower type if type==6, lw(medthick) lcolor(red*0.6)),  ///
ytitle("Change in belief impact {c 177} SEM" "(percentage points)") ///
    xtitle(" ", margin(t=5)) xsc(r(0.5 6.5) lcolor(none)) ysc(r(-18 0) lcolor(none)) ///
	yline(0, lcolor(gs10) lwidth(thin)) ///
	graphregion(color(white)) title("", color(black)) ///
	ylabel(-22(2)0, tlc(none) angle(0) glcolor(gs15) glwidth(thin)) ///
	legend(off) ///
	xline(2.5, lwidth(thin) lcolor(black) lp(dash)) ///
	xlabel(0.25 `" "Format:" " " "Statistic:" "' 1 `" "Dissimilar"  "' 2 `" "Similar" " " " " " " "{bf:Story}" "' 3 `" "Dissimilar" " " "Disimilar""' 4 `" "Dissimilar" " " "Similar" " " "{bf:Statistic}" "' 5 `" "Similar" " " "Dissimilar""' 6 `" "Similar" " " "Similar""') ///
	title("Change in belief impact from {it:Immediate} to {it:Delay}",  margin(b=3) color(black)) ysize(6) xsize(9)
	graph export "${pathout_robustness}/figures/figureA6a.pdf", replace 
	
	
	
	
	
	
	
	
restore
	
	
	* REcall
	
	preserve 
collapse (mean) combined_recall (sem) stderr = combined_recall, by (type)
rename combined_recall  dev
gen upper = dev + stderr
gen lower = dev - stderr


tw (scatter dev type if type==1, connect(l)  mcolor(ebblue*1.5)) ///
(scatter dev type if type==2, connect(l)  mcolor(ebblue*1)) ///
(scatter dev type if type==3, connect(l)  mcolor(red*2.2)) ///
	(rcap upper lower type if type==1, lw(medthick) lcolor(ebblue*1.5))  ///
	(rcap upper lower type if type==2, lw(medthick) lcolor(ebblue*1)) ///
	(rcap upper lower type if type==3, lw(medthick) lcolor(red*2.2))  ///
(scatter dev type if type==4, connect(l)  mcolor(red*1.5)) ///
(scatter dev type if type==5, connect(l)  mcolor(red*1)) ///
(scatter dev type if type==6, connect(l)  mcolor(red*0.6)) ///
	(rcap upper lower type if type==4, lw(medthick) lcolor(red*1.5))  ///
	(rcap upper lower type if type==5, lw(medthick) lcolor(red*1)) ///
		(rcap upper lower type if type==6, lw(medthick) lcolor(red*0.6)),  ///
ytitle("Mean Rate  {c 177} SEM") ///
    xtitle(" ") xsc(r(0.5 6.5) lcolor(none)) ysc(r(0 0.8) lcolor(none)) ///
	yline(0, lcolor(gs10) lwidth(thin)) ///
	graphregion(color(white)) title("", color(black)) ///
	ylabel(0(0.1)0.8, tlc(none) angle(0) glcolor(gs15) glwidth(thin)) ///
	legend(off) ///
xline(2.5, lwidth(thin) lcolor(black) lp(dash)) ///
	xlabel(0.25 `" "Format:" " " "Statistic:" "' 1 `" "Dissimilar"  "' 2 `" "Similar" " " " " " " "{bf:Story}" "' 3 `" "Dissimilar" " " "Disimilar""' 4 `" "Dissimilar" " " "Similar" " " "{bf:Statistic}" "' 5 `" "Similar" " " "Dissimilar""' 6 `" "Similar" " " "Similar""') ///
	title("Correct recall of information type and valence",  color(black)) ysize(6) xsize(9)
	graph export "${pathout_robustness}/figures/figureA6b.pdf", replace 
